cmake_minimum_required(VERSION 3.6.0)

project(EasyDeepLearningInferenceLive_Neoapi_Console VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(CMAKE_VERSION VERSION_LESS "3.7.0")
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()

if(CMAKE_CXX_COMPILER_IS_GNUCXX)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
endif()

# include libraries

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
link_libraries(Threads::Threads)

set (OPEN_EVISION_CPP_INCLUDE_WIN "C:/Program Files/Euresys/Open eVision 26.02/Include")
set (OPEN_EVISION_CPP_INCLUDE_LINUX "/opt/euresys/Open_eVision_26_02/include")

include_directories(${OPEN_EVISION_CPP_INCLUDE_LINUX})
link_libraries(dl)

set(NEOAPI_ROOT "/opt/baumer-neoapi-1.1.1-cpp")
include_directories(${NEOAPI_ROOT}/include)
add_library(neoapi_cpp SHARED IMPORTED)
set_property(TARGET neoapi_cpp PROPERTY IMPORTED_LOCATION ${NEOAPI_ROOT}/lib/libneoapi_cpp.so.1.1)

# define executable

add_executable(EasyDeepLearningInferenceLive_Neoapi_Console
    EasyDeepLearningInferenceLiveMain.cpp
    ProcessingHandler.cpp
    ProcessingHandler.h
    CameraHandler.cpp
    CameraHandler.h
)
target_compile_definitions(EasyDeepLearningInferenceLive_Neoapi_Console PRIVATE USE_NEOAPI)
target_link_libraries(EasyDeepLearningInferenceLive_Neoapi_Console PRIVATE neoapi_cpp)
